{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" id="c" method="post">
    <input type="hidden" name="goods_id" value="{$goods_id}">
        <div class="layui-form-item">
            <label class="layui-form-label">是否限制购买</label>
            <div class="layui-input-block" id="is_c3">

                <input type="radio" name="is_limit_level" value="0"  title="不限制"  lay-filter="ccc3" {eq name="goods_info.is_limit_level" value="0" }checked{/eq}>

                <input type="radio" name="is_limit_level" value="1" title="限制等级" lay-filter="ccc3" {eq name="goods_info.is_limit_level" value="1" }checked{/eq}>
            </div>
        </div>

    <div class="layui-form-item free1" style="display: none">
        <label class="layui-form-label">用户等级</label>
        <div class="layui-input-block">
            {volist name="level_list" id="vo"}
            <input type="checkbox" name="level_id[{$vo.id}]" title="{$vo.name}" lay-skin="primary" value="1" {eq name="vo.c1" value="1"}checked{/eq}>
            {/volist}
            <!--            <input type="checkbox" name="row[allowpost]" title="允许投稿" lay-skin="primary" value="1" {eq name="data.allowpost" value="1"}checked{/eq}>-->
            <!--            <input type="checkbox" name="row[allowpostverify]" title="投稿不需审核" lay-skin="primary" value="1" {eq name="data.allowpostverify" value="1"}checked{/eq}>-->
            <!--            <input type="checkbox" name="row[allowsendmessage]" title="允许发短消息" lay-skin="primary" value="1" {eq name="data.allowsendmessage" value="1"}checked{/eq}>-->
            <!--            <input type="checkbox" name="row[allowattachment]" title="允许上传附件" lay-skin="primary" value="1" {eq name="data.allowattachment" value="1"}checked{/eq}>-->
            <!--            <input type="checkbox" name="row[allowsearch]" title="搜索权限" lay-skin="primary" value="1" {eq name="data.allowsearch" value="1"}checked{/eq}>-->
        </div>
    </div>



    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['yznForm', 'form'], function () {
        var yznForm = layui.yznForm;
        var form = layui.form;
        var is_limit={$goods_info.is_limit_level};
        if (is_limit==1){
            $(".free1").show();
        }
        yznForm.bindevent($("form.layui-form"));

        form.on('radio(ccc3)',function (data){
            if($('#is_c3 input[name="is_limit_level"]:checked ').val() ==0){
                $(".free1").hide();
            }else{
                $(".free1").show();
            }
            form.render();
        });

        laydate.render({
            elem: '#ID-laydate'
        });

    });


</script>
{/block}